In mathematics, a generalized mean, also known as power mean or Hölder mean (named after Otto Hölder), is an abstraction of the Pythagorean means including arithmetic, geometric, and harmonic means.
Contents |
If p is a non-zero real number, we can define the generalized mean with exponent p (or power mean with exponent p) of the positive real numbers as:
While for p equal to 0 we assume that it's equal to the geometric mean (which is, in fact, the limit of means with exponents approaching zero):
Furthermore, for a sequence of positive weights with sum we can define weighted power means as follows:
For the sake of simplicity, we might assume that the weights are normalized so that they sum up to 1 (which can be easily done by dividing each weight by their sum), thus allowing some terms in the above formulae to be omitted:
The unweighted means can be easily produced by assuming that all weights equal 1/n. For exponents equal to positive or negative infinity the means are maximum and minimum, respectively, regardless of weights (and they are actually the limit points for exponents approaching the respective extremes):
In general, if p < q, then and the two means are equal if and only if .
It is true for real nonzero p, as well as zero, positive and negative infinity p, as defined above.
This follows from the fact that, for all p in ,
which can be proved using Jensen's inequality. In particular, for , the generalized mean inequality implies the Pythagorean means inequality as well as the inequality of arithmetic and geometric means.
minimum | |
harmonic mean | |
geometric mean | |
arithmetic mean | |
quadratic mean, a.k.a. root mean square | |
maximum |
We will prove weighted power means inequality, for the purpose of the proof we will assume without loss of generality that:
and
Proof for unweighted power means is easily obtained by substituting .
Suppose an average between power means with exponents p and q holds:
then:
We raise both sides to the power of −1 (strictly decreasing function in positive reals):
We get the inequality for means with exponents −p and −q, and we can use the same reasoning backwards, thus proving the inequalities to be equivalent, which will be used in some of the later proofs.
For any q the inequality between mean with exponent q and geometric mean can be transformed in the following way:
(the first inequality is to be proven for positive q, and the latter otherwise)
We raise both sides to the power of q:
in both cases we get the inequality between weighted arithmetic and geometric means for the sequence , which can be proved by Jensen's inequality, making use of the fact the logarithmic function is concave:
By applying (strictly increasing) exp function to both sides we get the inequality:
Thus for any positive q it is true that:
thus we have proved the inequality between geometric mean and any power mean.
Furthermore, we can prove that the geometric mean is the limit of power means for exponent approaching zero. Firstly, we will prove the limit:
It's easy to conclude that the limits of both the numerator and the denominator are both 0, so we can use L'Hôpital's rule:
Then we make use of the exponential function's continuity:
which was to be proven.
We are to prove that for any p < q the following inequality holds:
if p is negative, and q is positive, the inequality is equivalent to the one proved above:
The proof for positive p and q is as follows: Define the following function: . f is a power function, so it does have a second derivative:
which is strictly positive within the domain of f, since q > p, so we know f is convex.
Using this, and the Jensen's inequality we get:
after raising both side to the power of 1/q (an increasing function, since 1/q is positive) we get the inequality which was to be proven:
Using the previously shown equivalence we can prove the inequality for negative p and q by substituting them with, respectively, −q and −p, QED.
Minimum and maximum are the limits of power means at, respectively, and . The proof is as follows:
Suppose without loss of generality that x1 is the largest, while xn is the smallest of xi. First, using the squeeze theorem we will prove that:
It suffices to notice that for positive p the inequalities hold:
Then, making use of the limit:
and finally, we use the fact that the exponential function is continuous:
Similarly, for negative p:
since (for p < 0):
Thus:
and again, by continuity of the exp function:
The power mean could be generalized further to the generalized -mean:
which covers e.g. the geometric mean without using a limit. The power mean is obtained for .
A power mean serves a non-linear moving average which is shifted towards small signal values for small and emphasizes big signal values for big . Given an efficient implementation of a moving arithmetic mean called smooth
you can implement a moving power mean according to the following Haskell code.
powerSmooth :: Floating a => ([a] -> [a]) -> a -> [a] -> [a] powerSmooth smooth p = map (** recip p) . smooth . map (**p)